<template>
  <public-modal
    width="500px"
    :footer="false"
    title="退出"
    modalStyle="visitor-detailModal"
    :publicVisible="publicVisible"
    @handleOk="handleOk"
    @cancel="cancel"
  >
    <div slot="content">
      <div class="search-group" style="width: 100%; padding: 0">
        <div class="input-wrap" style="width: 100%">
          <div class="label">退出理由:</div>
          <div class="input-item" style="width: 100%">
            <a-textarea
              :maxLength="30"
              style="height: 100px; overflow: auto; resize: none"
              v-model="queryParam.auditMemo"
              placeholder="请输入退出理由"
            />
          </div>
        </div>
      </div>
    </div>
  </public-modal>
</template>
<script>
import publicModal from '@/components/publicModal'
import { auditRestaurant } from '@/api/restaurant'
export default {
  name: 'cancelModel',
  components: { publicModal },
  data() {
    return {
      queryParam: {
        auditMemo: '',
      },
      publicVisible: false,
    }
  },
  mounted() {},
  methods: {
    show(records) {
      this.queryParam = { ...records, auditStatus: 4 }
      this.publicVisible = true
    },
    async handleOk() {
      if (this.queryParam.auditMemo == undefined) {
        this.$message.error('请填写退出理由')
        return
      }
      try {
        let res = await auditRestaurant(this.queryParam)
        this.$message.success(res.message)
        this.publicVisible = false
        this.$emit('success')
      } catch {
        this.$message.error(res.message)
      }
    },
    cancel() {
      this.publicVisible = false
    },
  },
}
</script>
<style lang="less">
.visitor-detailModal {
  .formDetailStyle {
    padding: 0.2rem 0.6rem 0.2rem;
    .ant-form-item-label {
      width: 80px;
      label {
        font-size: 0.14rem;
        font-family: PingFang SC;
        font-weight: 500;
        color: #000;
      }
    }
    .ant-form-item-control-wrapper {
      font-size: 0.14rem;
      font-family: PingFang SC;
      font-weight: 500;
      color: #000;
    }
  }
}
</style>
